<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<!--
		Charisma v1.0.0

		Copyright 2012 Muhammad Usman
		Licensed under the Apache License v2.0
		http://www.apache.org/licenses/LICENSE-2.0

		http://usman.it
		http://twitter.com/halalit_usman
	-->
<meta charset="utf-8">
	<title>后台管理系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
	content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
<meta name="author" content="Muhammad Usman">

<!-- The styles -->
<link id="bs-css" href="css/bootstrap-cerulean.css" rel="stylesheet">
<style type="text/css">
body {
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}
</style>
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/charisma-app.css" rel="stylesheet">
<link href="css/jquery-ui-1.8.21.custom.css" rel="stylesheet">
<link href='css/fullcalendar.css' rel='stylesheet'>
<link href='css/fullcalendar.print.css' rel='stylesheet' media='print'>
<link href='css/chosen.css' rel='stylesheet'>
<link href='css/uniform.default.css' rel='stylesheet'>
<link href='css/colorbox.css' rel='stylesheet'>
<link href='css/jquery.cleditor.css' rel='stylesheet'>
<link href='css/jquery.noty.css' rel='stylesheet'>
<link href='css/noty_theme_default.css' rel='stylesheet'>
<link href='css/elfinder.min.css' rel='stylesheet'>
<link href='css/elfinder.theme.css' rel='stylesheet'>
<link href='css/jquery.iphone.toggle.css' rel='stylesheet'>
<link href='css/opa-icons.css' rel='stylesheet'>
<link href='css/uploadify.css' rel='stylesheet'>

<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
	  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

<!-- The fav icon -->
<link rel="shortcut icon" href="img/favicon.ico">

</head>

<body>
	<s:include value="header.jsp" />
	<!-- topbar ends -->
	<div class="container-fluid">
		<div class="row-fluid">

			<s:include value="left.jsp" />

			<div id="content" class="span10">
				<!-- content starts -->


				<div>
					<ul class="breadcrumb">
						<li><a href="index">主页</a> <span class="divider">/</span></li>
						<li><a href="#">终端信息修改</a></li>
					</ul>
				</div>

				<div class="sortable row-fluid">
					<div class="box-content">
						<form class="form-horizontal" action="editTerminal?terminalID=<s:property value="terminal.terminalId" />" method="post" id="form">
						  <fieldset>
						  <div class="control-group">
								<label class="control-label" for="branch">请选择网点：</label>
								<div class="controls">
								  <select id="branch" name="branch" style="width:290px;">
									<s:iterator value="branches" status="st">
										<option value="<s:property value="branchId" />" <s:if test="branchId==terminal.branch.branchId">selected="selected"</s:if>>
											<s:property value="branchName" />
										</option>
									</s:iterator>
								  </select>
								</div>
							  </div>
							<div class="control-group">
							  <label class="control-label" for="typeahead">终端名称:</label>
							  <div class="controls">
								<input name="terminal.name" value="<s:property value="terminal.name" />" type="text" class="span4 typeahead" id="name" data-items="2" style="float: left;"/>
							  </div>
							</div>
							<div class="control-group">
							  <label class="control-label" for="typeahead">终端密码:</label>
							  <div class="controls">
								<input name="terminal.terminalPwd" value="<s:property value="terminal.terminalPwd" />" type="text" class="span4 typeahead" data-items="2" style="float: left;"/>
							  </div>
							</div>
							<div class="control-group">
							  <label class="control-label" for="typeahead">3g卡号:</label>
							  <div class="controls">
								<input name="terminal.cardNumber" value="<s:property value="terminal.cardNumber" />" maxlength="11" type="text" class="span4 typeahead" id="card" data-items="2" style="float: left;"/>
							  </div>
							</div>
							<div class="control-group">
							  <label class="control-label" for="typeahead">管理密码:</label>
							  <div class="controls">
								<input name="terminal.adminPwd" value="<s:property value="terminal.adminPwd" />" type="text" class="span4 typeahead" id="typeahead" data-items="2" style="float: left;"/>
							  </div>
							</div>
							<s:if test="#session.admin.name=='ajyoubox'">
							<div class="control-group">
							</s:if>
							<s:else>
							<div class="control-group hide">
							</s:else>
							<div class="control-group">
							  <label class="control-label" for="typeahead">预留超大箱格比例(0-100):</label>
							  <div class="controls">
								<input name="terminal.superReserve" type="text" id="superReserve" value="<s:property value="terminal.superReserve" />" class="span4 typeahead" data-items="2" style="float: left;"/>
							  </div>
							</div>
							<div class="control-group">
							  <label class="control-label" for="typeahead">预留大箱格比例(0-100):</label>
							  <div class="controls">
								<input name="terminal.bigReserve" type="text" id="bigReserve" value="<s:property value="terminal.bigReserve" />" class="span4 typeahead" data-items="2" style="float: left;"/>
							  </div>
							</div>
							<div class="control-group">
							  <label class="control-label" for="typeahead">预留中箱格比例(0-100):</label>
							  <div class="controls">
								<input name="terminal.mediumReserve" id="mediumReserve" value="<s:property value="terminal.mediumReserve" />" type="text" class="span4 typeahead" data-items="2" style="float: left;"/>
							  </div>
							</div>
							<div class="control-group">
							  <label class="control-label" for="typeahead">预留小箱格比例(0-100):</label>
							  <div class="controls">
								<input name="terminal.smallReserve" id="smallReserve" value="<s:property value="terminal.smallReserve" />" type="text" class="span4 typeahead" data-items="2" style="float: left;"/>
							  </div>
							</div>
							</div>
							  <div class="form-actions">
								<button type="button" onclick="datacheck()" class="btn btn-primary">修改</button>
								<button class="btn" type="button" onclick="window.history.go(-1);">Cancel</button>
							  </div>																					
						  </fieldset>
						</form> 
					</div>
				</div>
				<!-- content ends -->
			</div>
			<!--/#content.span10-->
		</div>
		<!--/fluid-row-->

		<hr>

	<s:include value="footer.jsp" />

	</div>
	<!--/.fluid-container-->

	<!-- external javascript
	================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->

	<!-- jQuery -->
	<script src="js/jquery-1.7.2.min.js"></script>
	<!-- jQuery UI -->
	<script src="js/jquery-ui-1.8.21.custom.min.js"></script>
	<!-- transition / effect library -->
	<script src="js/bootstrap-transition.js"></script>
	<!-- alert enhancer library -->
	<script src="js/bootstrap-alert.js"></script>
	<!-- modal / dialog library -->
	<script src="js/bootstrap-modal.js"></script>
	<!-- custom dropdown library -->
	<script src="js/bootstrap-dropdown.js"></script>
	<!-- scrolspy library -->
	<script src="js/bootstrap-scrollspy.js"></script>
	<!-- library for creating tabs -->
	<script src="js/bootstrap-tab.js"></script>
	<!-- library for advanced tooltip -->
	<script src="js/bootstrap-tooltip.js"></script>
	<!-- popover effect library -->
	<script src="js/bootstrap-popover.js"></script>
	<!-- button enhancer library -->
	<script src="js/bootstrap-button.js"></script>
	<!-- accordion library (optional, not used in demo) -->
	<script src="js/bootstrap-collapse.js"></script>
	<!-- carousel slideshow library (optional, not used in demo) -->
	<script src="js/bootstrap-carousel.js"></script>
	<!-- autocomplete library -->
	<script src="js/bootstrap-typeahead.js"></script>
	<!-- tour library -->
	<script src="js/bootstrap-tour.js"></script>
	<!-- library for cookie management -->
	<script src="js/jquery.cookie.js"></script>
	<!-- calander plugin -->
	<script src='js/fullcalendar.min.js'></script>
	<!-- data table plugin -->
	<script src='js/jquery.dataTables.min.js'></script>

	<!-- chart libraries start -->
	<script src="js/excanvas.js"></script>
	<script src="js/jquery.flot.min.js"></script>
	<script src="js/jquery.flot.pie.min.js"></script>
	<script src="js/jquery.flot.stack.js"></script>
	<script src="js/jquery.flot.resize.min.js"></script>
	<!-- chart libraries end -->

	<!-- select or dropdown enhancer -->
	<script src="js/jquery.chosen.min.js"></script>
	<!-- checkbox, radio, and file input styler -->
	<script src="js/jquery.uniform.min.js"></script>
	<!-- plugin for gallery image view -->
	<script src="js/jquery.colorbox.min.js"></script>
	<!-- rich text editor library -->
	<script src="js/jquery.cleditor.min.js"></script>
	<!-- notification plugin -->
	<script src="js/jquery.noty.js"></script>
	<!-- file manager library -->
	<script src="js/jquery.elfinder.min.js"></script>
	<!-- star rating plugin -->
	<script src="js/jquery.raty.min.js"></script>
	<!-- for iOS style toggle switch -->
	<script src="js/jquery.iphone.toggle.js"></script>
	<!-- autogrowing textarea plugin -->
	<script src="js/jquery.autogrow-textarea.js"></script>
	<!-- multiple file upload plugin -->
	<script src="js/jquery.uploadify-3.1.min.js"></script>
	<!-- history.js for cross-browser state change on ajax -->
	<script src="js/jquery.history.js"></script>
	<!-- application script for Charisma demo -->
	<script src="js/charisma.js"></script>
	<script type="text/javascript">
		function datacheck() {
			var  re=/^[0-9]+$/;
			if (form.name.value == "") {
				alert("请输入终端名称！");
			}else if (!re.test(form.superReserve.value)||form.superReserve.value<0||form.superReserve.value>100) {
				alert("请输入正确的比例！");
			} else if (!re.test(form.bigReserve.value)||form.bigReserve.value<0||form.bigReserve.value>100) {
				alert("请输入正确的比例！");
			} else if (!re.test(form.mediumReserve.value)||form.mediumReserve.value<0||form.mediumReserve.value>100) {
				alert("请输入正确的比例！");
			} else if (!re.test(form.smallReserve.value)||form.smallReserve.value<0||form.smallReserve.value>100) {
				alert("请输入正确的比例！");
			}else {
				form.submit();//送出表单中的资料
				alert("提交成功！");
			}
		}
	</script>


</body>
</html>
